Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): directory sync fix + test bed rewrites #421

Merged
merged 11 commits into from
Jan 4, 2022
Merged

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Jan 4, 2022

🧰 Changes

Another follow-up to #410. This time we're focusing on our docs commands:

  • Fixed a couple bugs with our logic for syncing markdown directories:
    1. It previously was returning a successful exit code (0) if the docs syncing failed for any reason. Now a failure rejects the promise and returns a failure exit code (1).
    2. If one doc was invalid and failed, it would previously continue with the rest, and print a JSON object of the docs that were successful. Now, when a doc fails, it exits the entire process with a failure exit code (1) and returns an error message containing the problematic file path.
  • Replacing all console.log instances with console.info.
  • Rewriting our tests to check for the function outputs (i.e. Promise resolution/rejection) rather than checking for console outputs.
  • Makes our version prompt (see feat: add version selection to all relevant commands #344) more generic so the language makes sense in more places.

🧬 QA & Testing

See tests.

@kanadgupta kanadgupta requested a review from erunion January 4, 2022 22:55
@kanadgupta kanadgupta added bug refactor Issues about tackling technical debt labels Jan 4, 2022
@@ -6,7 +6,7 @@ exports.generatePrompts = (versionList, selectOnly = false) => [
{
type: 'select',
name: 'option',
message: 'Would you like to use an existing version or create a new one to associate with your OAS file?',
Copy link
Member Author

@kanadgupta kanadgupta Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were previously using this OAS-specific language in a bunch of places (version commands, docs commands, etc.) 😬

Co-Authored-By: Jon Ursenbach <jon@ursenba.ch>
@kanadgupta kanadgupta merged commit b793afc into main Jan 4, 2022
@kanadgupta kanadgupta deleted the fix/docs-commands branch January 4, 2022 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants